<?php //echo $this->form->render($this);?>

<?php 
  $this->headLink()
    ->appendStylesheet('application/modules/Story/externals/styles/annotation.css'); 
?>

<?php $this->headScript()->appendFile('application/modules/Story/externals/scripts/jquery-1.7.1.js') ?>
<?php $this->headScript()->appendScript('jQuery.noConflict();') ?>
<?php $this->headScript()->appendFile('application/modules/Story/externals/scripts/jquery-ui-1.8.17.js') ?>
<?php $this->headScript()->appendFile('application/modules/Story/externals/scripts/jquery.annotate.js') ?>


<script language="javascript">
	jQuery.noConflict();
	var uploadSignupPhoto = function() {      
		$('story_create_3').submit();
    }
	
	<?php if($this->photo_url): ?>
	jQuery(window).load(function() {		
		jQuery("#toAnnotate").annotateImage({
			getUrl: "<?php echo $this->baseUrl();?>/stories/comics/<?php echo $this->photo_id; ?>/get-bubbles",
			saveUrl: "<?php echo $this->baseUrl();?>/stories/comics/<?php echo $this->photo_id; ?>/save-bubble",
			deleteUrl: "<?php echo $this->baseUrl();?>/stories/comics/<?php echo $this->photo_id; ?>/delete-bubble",
			editable: true
		});
	});	
	<?php endif; ?>	 
</script>
	
<form id="story_create_3" enctype="multipart/form-data" class="global_form" action="<?php echo $this->baseUrl();?>/stories/createex" onsubmit="return en4.story.handlesubmit(this);" method="post"><div><div><div class="form-elements">
<?php if($this->photo_url): ?>
<div id="image_comic" style="display: block;">
	<img id="toAnnotate" src="<?php echo $this->photo_url; ?>"/>
</div>
<?php endif; ?>

<div id="title-wrapper" class="form-wrapper">
	<div id="title-label" class="form-label">
		<label for="title" class="required">Title</label>
	</div>
	<div id="title-element" class="form-element">
		<input type="text" name="title" id="title" value="<?php echo $this->title; ?>">
	</div>
</div>
<?php if(!empty($this->story_id)): ?>
<div id="description-wrapper" class="form-wrapper">
	<div id="description-label" class="form-label">
		<label for="description" class="required">Description</label>
	</div>
	<div id="description-element" class="form-element">
		<input maxlength="255" type="text" name="description" id="description" value="<?php echo $this->description; ?>">
	</div>
</div>
<?php endif; ?>
<div id="photo-wrapper" class="form-wrapper"><div id="photo-label" class="form-label"><label for="photo" class="optional">Change Story</label></div>
<div id="photo-element" class="form-element">
<p class="description">Please upload your story (max size 1MB). Please note when changing the story photo, all data will be lost.</p>
<input type="hidden" name="MAX_FILE_SIZE" value="134217728" id="MAX_FILE_SIZE">
<input type="file" name="photo" id="photo" onchange="javascript:uploadSignupPhoto();"></div>
</div>

<div id="agree-wrapper" class="form-wrapper"><div class="form-label" id="agree-label">&nbsp;</div>
<div id="agree-element" class="form-element">
<input type="hidden" name="agree" value=""><input type="checkbox" name="agree" id="agree" value="1" checked="checked">
<label for="agree" class="optional">I accept the term and privacy of story creation</label></div></div>
<div id="buttons-wrapper" class="form-wrapper"><div id="buttons-label" class="form-label">&nbsp;</div><div id="buttons-element" class="form-element"><div class="form-wrapper" id="buttons-wrapper"><fieldset id="fieldset-buttons">
<!--
<button name="submit_3" id="submit_3" type="submit">Post Story</button>
-->
<button name="submit_3" id="submit_3" type="submit">Save</button>
<button name="publish" id="publish_3" type="submit">Save &amp; Publish</button>

 or <a name="cancel" id="cancel" type="button" href="javascript:void(0);" onclick="history.go(-1); return false;">cancel</a></fieldset></div></div></div>

<input type="hidden" name="category_id" value="3" id="category_id">

<input type="hidden" name="tags" value="" id="tags">
<input type="hidden" name="story_category" value="" id="story_category">
<input type="hidden" name="story_id" value="<?php echo $this->story_id;?>" id="story_id">

<input type="hidden" name="auth_view" value="" id="auth_view">

<input type="hidden" name="auth_comment" value="" id="auth_comment"></div></div></div></form>
